package com.wangzhen.codebase.meituan.controller;

import com.sankuai.inf.leaf.common.Result;
import com.sankuai.inf.leaf.service.SegmentService;
import com.sankuai.inf.leaf.service.SnowflakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DistributeIdController {

    @Autowired
    private SegmentService segmentService;

    @Autowired
    private SnowflakeService snowflakeService;

    @GetMapping("/getId")
    public Result getId() {
        Result result = segmentService.getId("leaf-segment-test");
        return result;
    }

    @GetMapping("/getId2")
    public Result getId2() {
        Result result = snowflakeService.getId("leaf-segment-test");
        return result;
    }


}
